/*
 * CruiserConfiguration.cpp
 *
 *  Created on: Jun 21, 2009
 *      Author: computer
 */

#include "CruiserConfiguration.h"

CruiserConfiguration::CruiserConfiguration(int _numberConfiguration)
: numberConfiguration(_numberConfiguration){ }

CruiserConfiguration::~CruiserConfiguration() { }

CruiserConfiguration* CruiserConfiguration::createCruiserConfiguration(int _type) throw (InvalidBoatConfiguration) {
	switch (_type) {
	case 1:
		return new CruiserConfiguration1();
		break;
	case 2:
		return new CruiserConfiguration2();
		break;
	default:
		throw InvalidBoatConfiguration(2);
	}
}

int CruiserConfiguration::getNumberConfiguration() const {
	return numberConfiguration;
}

CruiserConfiguration1::CruiserConfiguration1() : CruiserConfiguration(1){ }

CruiserConfiguration1::~CruiserConfiguration1() { }

RectangularBoatShape* CruiserConfiguration1::getShape(const string& _name, const Point<int>& _origin, char _filledChar) const {
	return new RectangularBoatShape(_name, _origin, Dimension<int>(4,1), _filledChar);
}

CruiserConfiguration2::CruiserConfiguration2() : CruiserConfiguration(2) { }

CruiserConfiguration2::~CruiserConfiguration2() { }

RectangularBoatShape* CruiserConfiguration2::getShape(const string& _name, const Point<int>& _origin, char _filledChar) const {
	return new RectangularBoatShape(_name, _origin, Dimension<int>(1,4), _filledChar);
}
